/*
 * @Description:
 * @Autor: zhzj
 * @Date: 2020-12-21 14:58:14
 * @LastEditors: zhzj
 * @LastEditTime: 2020-12-21 14:58:14
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 获取表格数据
export const getRtgoodsData = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/claimRtGoods`, { params });
// export const getRtgoodsData = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/claimRefund`, { params });
// 获取理赔退货备件明细数据
export const getPartsGroup = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/claimRtGoods/selectPartItemByApplyNum`, { params });

// 获取索賠配件数据
export const excelOutPut = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/rtGoods/export`, { params });

// 保存审批
export const postApprove = (params) => axios.post(`${SERVER.CMSCLOUD_WMS}/part/claimRtGoods/saveapprove`, params)


// 获取审批历史
export const getApproveRecord = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/claimRtGoods/selectPartAuditByApplyNum`, { params });

// 获取明细基本信息
export const getClaimRefundInfo = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/claimRtGoods/getClaimRefundInfo`, { params });


// / 导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);


  //搜索经销商
export const byAllInfo = params => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/dealerInfo/byAllInfo`, { params });


// 查询事业部
export const getOrgList = params => axios.get(`${SERVER.SYSMANAGE}/org/getBusinessOrg`, { params });


//明细导出
export const getRefundDetailExport = params => {
  params = Object.assign(params, { menuId: '-1' });
  return axios({
    url: `${SERVER.CMSCLOUD_WMS}/part/claimRtGoods/detailExport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
